<template>
    <div>
        <!-- Indicator组件 -->
        <el-badge :type="num == index+1?'primary':'info'" 
          v-for="num in randomSize" :key="num" :value="num<10? '0' + num : num " 
          class="item"
          @click.native="clickIndex(num - 1)">
          </el-badge>
    </div>
</template>

<script>
import { mapState, mapMutations } from "vuex";
export default {
  data() {
    return {
      // total: 20,
      // current: 1,
    };
  },
  methods: {
    ...mapMutations("study", ["SET_INDEX"]),
    clickIndex(index) {
      this.SET_INDEX(index);
    }
  },
  computed: {
    ...mapState("study", ["index", "randomSize"])
  }
};
</script>

<style scoped>
</style>